import Vue from 'vue'
import Router from 'vue-router'
import rewrite from '@/components/rewrite'
import delivery from '@/components/delivery'
import cart from '@/components/cart'
import order from '@/components/order'
import my from '@/components/my'
import parents from '@/components/parents'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'parents',
      component: parents,
      redirect: '/rewrite',
      children: [
        {
          path: 'rewrite',
          name: 'rewrite',
          component: rewrite
        },
        {
          path: 'cart',
          name: 'cart',
          component: cart
        },
        {
          path: 'order',
          name: 'order',
          component: order
        },
        {
          path: 'my',
          name: 'my',
          component: my
        }
      ]
    },
    {
      path: '/delivery',
      name: 'delivery',
      component: delivery
    }
  ],
  linkActiveClass:'active'
})
